using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("MatchEvents")]
	[Serializable]
    public class MatchEvent : DBO<MatchEvent>
    {
		#region Fields
		
		private int? _IdMatchEvent;
		private int? _IdMatch;
		private string _Team;
		private string _Minute;
		private string _Score;
		private string _EventType;
		private string _Description;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public MatchEvent()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdMatchEvent 
		/// </summary>
		/// <param name="IdMatchEvent">The IdMatchEvent</param>
		public MatchEvent(int? IdMatchEvent )
		{
			this.IdMatchEvent = IdMatchEvent;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdMatchEvent">Sets int? value for IdMatchEvent</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="Team">Sets string value for Team</param>
		/// <param name="Minute">Sets string value for Minute</param>
		/// <param name="Score">Sets string value for Score</param>
		/// <param name="EventType">Sets string value for EventType</param>
		/// <param name="Description">Sets string value for Description</param>
		public MatchEvent(int? idMatchEvent, int? idMatch, string team, string minute, string score, string eventType, string description)
		{
			this.IdMatchEvent = idMatchEvent;
			this.IdMatch = idMatch;
			this.Team = team;
			this.Minute = minute;
			this.Score = score;
			this.EventType = eventType;
			this.Description = description;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdMatchEvent
		/// </summary>
		[ColumnAttribute("IdMatchEvent", SqlDbType.Int , 4 , true, true, false)]
		public int? IdMatchEvent
		{
			set
			{
				this._IdMatchEvent = value;
			}
			get
			{
				return this._IdMatchEvent;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Team
		/// </summary>
		[ColumnAttribute("Team", SqlDbType.NVarChar , 50 , false, false, true)]
		public string Team
		{
			set
			{
				this._Team = value;
			}
			get
			{
				return this._Team;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Minute
		/// </summary>
		[ColumnAttribute("Minute", SqlDbType.NVarChar , 20 , false, false, true)]
		public string Minute
		{
			set
			{
				this._Minute = value;
			}
			get
			{
				return this._Minute;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Score
		/// </summary>
		[ColumnAttribute("Score", SqlDbType.NVarChar , 10 , false, false, true)]
		public string Score
		{
			set
			{
				this._Score = value;
			}
			get
			{
				return this._Score;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for EventType
		/// </summary>
		[ColumnAttribute("EventType", SqlDbType.NVarChar , 50 , false, false, true)]
		public string EventType
		{
			set
			{
				this._EventType = value;
			}
			get
			{
				return this._EventType;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Description
		/// </summary>
		[ColumnAttribute("Description", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Description
		{
			set
			{
				this._Description = value;
			}
			get
			{
				return this._Description;
			}
		}
		
		
		/// <summary>
		/// Get a Match of current MatchEvent object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdMatchEvent]
            /// </summary>
            public string IdMatchEvent
            {
                get
                {
                    return "IdMatchEvent";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [Team]
            /// </summary>
            public string Team
            {
                get
                {
                    return "Team";
                }
            }
            /// <summary>
            /// Get the name of column [Minute]
            /// </summary>
            public string Minute
            {
                get
                {
                    return "Minute";
                }
            }
            /// <summary>
            /// Get the name of column [Score]
            /// </summary>
            public string Score
            {
                get
                {
                    return "Score";
                }
            }
            /// <summary>
            /// Get the name of column [EventType]
            /// </summary>
            public string EventType
            {
                get
                {
                    return "EventType";
                }
            }
            /// <summary>
            /// Get the name of column [Description]
            /// </summary>
            public string Description
            {
                get
                {
                    return "Description";
                }
            }
        }
        #endregion
    }
}
